package com.tledu.production.service.device.impl;

import com.tledu.production.mapper.device.DeviceFaultMapper;
import com.tledu.production.model.device.DeviceFault;
import com.tledu.production.service.device.DeviceFaultService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;


@AllArgsConstructor
@Service
public class DeviceFaultServiceImpl implements DeviceFaultService {
    private final DeviceFaultMapper deviceFaultMapper;

    //分页
    @Override
    public List<DeviceFault> list() {
        return deviceFaultMapper.list();
    }
    //添加
    @Override
    public int insert(DeviceFault deviceFault) {
        return deviceFaultMapper.insert(deviceFault);
    }


    //更新
    @Override
    public int update(DeviceFault deviceFault) {
        return deviceFaultMapper.update(deviceFault);
    }

    //删除
    @Override
    public int delete(String deviceFaultId){
        return deviceFaultMapper.delete(deviceFaultId);
    }

    //根据id查询
    @Override
    public DeviceFault findById(String deviceFaultId) {
        return deviceFaultMapper.findById(deviceFaultId);
    }

    @Override
    public List<DeviceFault> search(String type, String searchText) {
        return deviceFaultMapper.search(type, searchText);
    }


    //富文本
    @Override
    public String findEdit(String deviceFaultId) {

        return deviceFaultMapper.findEdit(deviceFaultId);
    }

    //富文本保存
    @Override
    public int save(String deviceFaultId) {
        return deviceFaultMapper.save(deviceFaultId);
    }
}
